package com.xb.cloud.gateway.client;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * 服务器端adapter上下文,尽量让上下文不被adapter更改;
 */
public class AdapterContext {

	protected RequestInfo requestInfo;

	/**
	 * url后缀不包含host和参数
	 */
	protected String urlPath;
	private boolean hasToken;

	protected RtnInfo rtnInfo;
	protected String requestIp;

	@JSONField(serialize=false)   
	protected HttpServletRequest httpRequest;
	@JSONField(serialize=false)
	protected HttpServletResponse httpResponse;

	private Long companyId;
	protected Long currentUserId;
	protected String currentUserName;
	
	/**
	 * 当前登录商家的merchant id;
	 */
	protected Long currentMerchantUserId;//TODO 测试hardcode
	protected String currentMerchantUserName;
	

	public RequestInfo getRequestInfo() {
		return requestInfo;
	}

	public void setRequestInfo(RequestInfo requestInfo) {
		this.requestInfo = requestInfo;
	}

	public String getUrlPath() {
		return urlPath;
	}

	public void setUrlPath(String urlPath) {
		this.urlPath = urlPath;
	}

	public boolean isHasToken() {
		return hasToken;
	}

	public void setHasToken(boolean hasToken) {
		this.hasToken = hasToken;
	}

	public RtnInfo getRtnInfo() {
		return rtnInfo;
	}

	public void setRtnInfo(RtnInfo rtnInfo) {
		this.rtnInfo = rtnInfo;
	}

	public String getRequestIp() {
		return requestIp;
	}

	public void setRequestIp(String requestIp) {
		this.requestIp = requestIp;
	}

	public HttpServletRequest getHttpRequest() {
		return httpRequest;
	}

	public void setHttpRequest(HttpServletRequest httpRequest) {
		this.httpRequest = httpRequest;
	}

	public HttpServletResponse getHttpResponse() {
		return httpResponse;
	}

	public void setHttpResponse(HttpServletResponse httpResponse) {
		this.httpResponse = httpResponse;
	}

	public long getCompanyId() {
		return companyId;
	}

	public void setCompanyId(long companyId) {
		this.companyId = companyId;
	}

	public Long getCurrentUserId() {
		return currentUserId;
	}

	public void setCurrentUserId(long currentUserId) {
		this.currentUserId = currentUserId;
	}

	public String getCurrentUserName() {
		return currentUserName;
	}

	public void setCurrentUserName(String currentUserName) {
		this.currentUserName = currentUserName;
	}

	public Long getCurrentMerchantUserId() {
		return currentMerchantUserId;
	}

	public void setCurrentMerchantUserId(Long currentMerchantUserId) {
		this.currentMerchantUserId = currentMerchantUserId;
	}

	public String getCurrentMerchantUserName() {
		return currentMerchantUserName;
	}

	public void setCurrentMerchantUserName(String currentMerchantUserName) {
		this.currentMerchantUserName = currentMerchantUserName;
	}

}
